import { TaskType } from '../reducer/todo';
import { ActionType } from '../reducer/todo';

export const updateByIdAction = (id: number): ActionType => ({
  type: 'todo/updateById',
  payload: id,
});

export const clearDoneAction = (): ActionType => ({
  type: 'todo/clearDone',
});

// 3. 封装action创建函数  💥 需要指定返回值类型
export const addAction = (task: TaskType): ActionType => ({
  type: 'todo/add',
  payload: task,
});
